package com.example.web;

import com.example.domain.Customer;
import com.example.service.CustomerService;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * Created by bethinner on 2017/1/4.
 */
@SpringBootApplication
@Controller
@RequestMapping("/customer")
public class CustomerController {

    @Autowired
    private CustomerService customerService;
    private Logger logger = Logger.getLogger(CustomerController.class);

    @RequestMapping(method = RequestMethod.POST,value = "/getCustomer")
    @ResponseBody
    public Customer getCustomer(int id){
        Customer customer = customerService.getCustomer(id);
        logger.info("log4j");
        return customer;
    }
}
